home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1995.rar / 1995 / DEC / DI9512DR / row.pas < prev    next >
Pascal/Delphi Source File  |  1995-10-26  |  1KB  |  55 lines

  1. unit Row;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, Grids, DBGrids, DB, DBTables, StdCtrls, Buttons;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     DataSource1: TDataSource;
  12.     Table1: TTable;
  13.     DBGrid1: TDBGrid;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     Label3: TLabel;
  17.     BitBtn1: TBitBtn;
  18.     BitBtn2: TBitBtn;
  19.     procedure DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
  20.       Field: TField; State: TGridDrawState);
  21.     procedure BitBtn2Click(Sender: TObject);
  22.     procedure BitBtn1Click(Sender: TObject);
  23.   private
  24.     { Private declarations }
  25.   public
  26.     { Public declarations }
  27.   end;
  28.  
  29. var
  30.   Form1: TForm1;
  31.  
  32. implementation
  33.  
  34. {$R *.DFM}
  35.  
  36. procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
  37.   Field: TField; State: TGridDrawState);
  38. begin
  39.   if Table1.FieldByName('OwesMe').AsFloat > 25 then
  40.      DBGrid1.Canvas.Font.Color := clRed;
  41.   DBGrid1.DefaultDrawDataCell(Rect, Field, State);
  42. end;
  43.  
  44. procedure TForm1.BitBtn2Click(Sender: TObject);
  45. begin
  46.   Close;
  47. end;
  48.  
  49. procedure TForm1.BitBtn1Click(Sender: TObject);
  50. begin
  51.   showMessage('I will take care of our little friend . . .');
  52. end;
  53.  
  54. end.
  55.